package com.guat.util;

import java.io.File;
import java.util.UUID;

public class FileNameUtil {
    //保存目录
    public static File dir = new File("D:\\Project\\2023.9.5\\my_demo\\src\\main\\webapp\\img\\");
    //缓存目录
    public static File tmpdir = new File("D:\\Project\\2023.9.5\\my_demo\\src\\main\\webapp\\tmp\\");


    public static String getSaveFilePath(String type){
        String name = UUID.randomUUID().toString();
        return dir.getAbsolutePath()+"\\"+name+type;
    }

    public static void main(String[] args) {
        String s1 = FileNameUtil.getSaveFilePath(".jpg");;
        System.out.println(s1);
    }
}
